﻿<%@ Page MasterPageFile="~/Site.Master" Language="C#" AutoEventWireup="true" CodeBehind="ShipRuleNear.aspx.cs" Inherits="RabbitManage.UI.ShipRuleNear" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

    <form id="form1" action="/Action/ShipRuleNearAdd.aspx" method="POST">
        
    <script type="text/javascript">
        
        form1.onsubmit = function (e) {
            e.preventDefault();

            var data = {};
            for (var i = 0, ii = form1.length; i < ii; ++i) {
                var input = form1[i];
                if (input.name) {
                    data[input.name] = input.value;
                }
            }

            var xhr = new XMLHttpRequest();
            xhr.open(form1.method, form1.action, true);
            xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');

            xhr.send(JSON.stringify(data));

            xhr.onloadend = function () {
                if (xhr.responseText == "true") {
                    window.location = "/UI/ShipRuleNear.aspx";
                } else {
                    alert(xhr.responseText);
                }
            };
        };
        
    </script>

    <section class="contact">

        <h3>自营配送范围:</h3>
        
        <table>
            
    <asp:Repeater runat="server" ID="myRepeater" >
        <ItemTemplate>
            <tr>
                                
                <td>
                    <%#Container.DataItem %>
                </td>
                      
                <td>
                    <a href="/Action/ShipRuleNearDelete.aspx?id=<%#Container.DataItem %>" onclick="return confirm('确认删除？')">删除</a>
                </td>

            </tr>
        </ItemTemplate>
    </asp:Repeater>
                
        </table>
        
        <input type="text" id="inputRegion" name="Region" />

<%--    <table>
        
        <tr>
            <td>自营配送范围:</td>
            <td>
                <input type="text" id="inputRegion" name="Region" />
            </td>
        </tr>
        
    </table>--%>
        
    <input type="submit" value="保存"  />

<%--        <script type="text/javascript">
            addressInit('cmbProvince', 'cmbCity', 'cmbArea', '<%=item.Location.Province %>', '<%=item.Location.City %>', '<%=item.Location.Region %>');
        </script>--%>
        
    </section>
        
    </form>
</asp:Content>
